package top.tagao.m03_beHavioralPatterns.b_03_state.new_way;

import com.alibaba.fastjson.JSON;
import top.tagao.m03_beHavioralPatterns.b_03_state.ActivityService;
import top.tagao.m03_beHavioralPatterns.b_03_state.Result;
import top.tagao.m03_beHavioralPatterns.b_03_state.Status;
import top.tagao.m03_beHavioralPatterns.b_03_state.old_way.ActivityExecStatusController;

/**
 * @author Viktor_Liu
 * @Date 2022/8/13 19:46
 */
public class Main {
    public static void main(String[] args) {
        // 初始化数据
        String activityId = "100001";
        ActivityService.init(activityId, Status.Editing);


        //上下文环境
        StateHandler stateHandler = new StateHandler();
        Result result = stateHandler.arraignment(activityId, Status.Editing);
        System.out.println("测试结果(编辑中To提审活动)：" +JSON.toJSONString(result));
        System.out.println("活动信息：{} " + JSON.toJSONString(ActivityService.queryActivityInfo(activityId)));


       result = stateHandler.checkPass(activityId, Status.Check);
        System.out.println("测试结果(编辑中To提审活动)：" +JSON.toJSONString(result));
        System.out.println("活动信息：{} " + JSON.toJSONString(ActivityService.queryActivityInfo(activityId)));
        System.out.println("状态：{}" +    JSON.toJSONString(ActivityService.queryActivityInfo(activityId).getStatus() ));



    }
}
